import React from 'react'
import { useDispatch, useSelector } from 'react-redux'
import * as action from './store/index'

const ReduxDemo = () => {
  const dispatch = useDispatch()
  const { num } = useSelector((state) => state.DemoRedux_index)
  const getRedux = () => {
    dispatch(action.getlist())
  }
  return (
    <>
      <div><button onClick={getRedux}>redux</button><span>{num}</span></div>
    </>
  )
}
export default ReduxDemo
